package org.example.springcloud.service;

import org.example.springcloud.service.fallbak.PaymentFallbackHystrixService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@Component
@FeignClient(value = "CLOUD-PROVIDER-PAYMENT",fallback = PaymentFallbackHystrixService.class)
//@FeignClient(value = "CLOUD-PROVIDER-PAYMENT")
public interface PaymentHystrixService {
//    cloud-payment-service
    @GetMapping("payment/hystrix/info/ok/{id}")
    String paymentInfo_OK(@PathVariable("id") Integer id);

    @GetMapping("payment/hystrix/info/timeout/{id}")
    String paymentInfo_TimeOut(@PathVariable("id") Integer id);
}
